from EzSymlink.sltools import Sl_Tools
from EzSymlink.sltools import Drw_Tools
from EzSymlink.conf import exc_obj
import time


def wast_time(func):
    def inner():
        start_time = time.time()
        v = func()
        end_tim = time.time()
        print("所有程序完成，总共用时%.3f秒"%(end_tim - start_time))
        return v

    return inner

@wast_time
def main():
    exec_funcs=None
    exec_funcs2=None
    if "symlink采集" in exc_obj["funcs"] or "symlink转发" in exc_obj["funcs"] or "紫金桥" in exc_obj["funcs"] or "symlink转发新" in exc_obj["funcs"]:
        exec_funcs=Sl_Tools()
    if  "紫金桥点" in exc_obj["funcs"]:
        exec_funcs2=Drw_Tools()
    if "symlink采集" in exc_obj["funcs"]:
        #exec_funcs.symlink_cj()
        pass
    if "symlink转发" in exc_obj["funcs"]:
        exec_funcs.symlink_zf()
    if "紫金桥" in exc_obj["funcs"]:
        exec_funcs.zjq()
    if "symlink转发新" in exc_obj["funcs"]:
        exec_funcs.symlink_zf_new()
    if "紫金桥点" in exc_obj["funcs"]:
        exec_funcs2.zjq_tags()
if __name__=="__main__":
    Sl_Tools().main_cycle()

